#ifndef HTTP_H
#define HTTP_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>

class http : public QObject
{
    Q_OBJECT
public:
    explicit http(QString httpUrl, QObject *parent = nullptr);
    ~http();

    void setHttpUrl(QString url);
    QString getHttpUrl();
    void setSuffix(QString suffix);
    QString getSuffix();

    void httpPostHandle(QByteArray data, QString suffix);
    void httpGetHandle(QString suffix);
signals:
    void uploadProgressChanged(QString suffix, qint64 sendBytes, qint64 allBytes);
    void requestFinished(QString ret);

public slots:
    void requestFinish(QNetworkReply* reply);
    void uploadProgress1(qint64 sendBytes, qint64 allBytes);

private:
    QString m_httpUrl = NULL;
    QString m_suffix = NULL;



};

#endif // HTTP_H
